package com.example.hangzhou.welbeing.mytestdemoapp.other;

import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.example.hangzhou.welbeing.mytestdemoapp.R;

import java.util.ArrayList;
import java.util.List;

/**
 * 杭州惟君医疗科技有限公司10
 * Created by 20433 on 2018/3/8
 */

public class EquipmentAdapter extends  RecyclerView.Adapter<EquipmentAdapter.ViewHolder> implements View.OnClickListener {
    private OnRecyclerViewItemClickListener mOnItemClickListener = null;
    private List<?> mlist = new ArrayList<>();
    public void setOnItemClickListener(OnRecyclerViewItemClickListener listener) {
        this.mOnItemClickListener = listener;
    }
    @Override
    public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
        View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_equipment,parent,false);
        ViewHolder viewHolder = new ViewHolder(view);
        view.setOnClickListener(this);
        return viewHolder;
    }

    @Override
    public void onBindViewHolder(ViewHolder holder, int position) {

    }

    @Override
    public int getItemCount() {
        return 10;
    }

    @Override
    public void onClick(View view) {
        if(mOnItemClickListener != null ){
            mOnItemClickListener.onItemClick(view);
        }
    }
    /**
     * 身体布局Holder
     */
    static class ViewHolder extends RecyclerView.ViewHolder {

        public ViewHolder(View itemView) {
            super(itemView);

        }
    }
}
